﻿<Window x:Class="Client.WpfApplication.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:cqrsServiceReference="clr-namespace:Client.WpfApplication.CqrsServiceReference"
        Title="MainWindow"
        Height="361"
        Width="535">
    
  <Grid>
    <TextBox HorizontalAlignment="Left"
             Height="23"
             TextWrapping="Wrap"
             Text="{Binding Path=SelectedItem.Name, Mode=TwoWay}"
             VerticalAlignment="Top"
             Width="132"
             Margin="10,10,0,0" />
    <Button Content="{Binding ButtonLabel}"
            IsEnabled="{Binding ButtonEnabled}"
            HorizontalAlignment="Left"
            VerticalAlignment="Top"
            Width="75"
            Margin="148,10,0,0"
            Height="23"
            Command="{Binding SetNameCommand}"
            CommandParameter="{Binding SelectedItem}" />
    <ListBox HorizontalAlignment="Left"
             Height="271"
             VerticalAlignment="Stretch"
             HorizontalContentAlignment="Stretch"
             Width="497"
             Margin="10,38,0,0"
             ItemsSource="{Binding Items}"
             SelectionChanged="Selector_OnSelectionChanged"
             RenderTransformOrigin="0.434,0.31">
      <ListBox.ItemTemplate>
        <DataTemplate DataType="cqrsServiceReference:DomainModelDto">
          <StackPanel Orientation="Horizontal">
            <TextBlock x:Name="NameLabel" Text="{Binding Name}"></TextBlock>
            <TextBlock Text=" "></TextBlock>
            <TextBlock x:Name="VersionLabel" Text="{Binding Version}"></TextBlock>
          </StackPanel>
        </DataTemplate>
      </ListBox.ItemTemplate>
    </ListBox>
    <Button Content="Batch Create"
            Command="{Binding BatchInsertCommand}"
            HorizontalAlignment="Left"
            VerticalAlignment="Top"
            Width="87"
            Margin="228,10,0,0" Click="Button_Click_1" Height="23" />
    <Button Content="Refresh"
            HorizontalAlignment="Left"
            VerticalAlignment="Top"
            Width="75"
            Margin="319,10,0,0"
            Click="Button_Click" Height="23" />

  </Grid>
</Window>